package com.aids_malaria.http.response;

import android.arch.persistence.room.ColumnInfo;
import android.arch.persistence.room.Dao;
import android.arch.persistence.room.Entity;
import android.arch.persistence.room.PrimaryKey;
import android.support.annotation.NonNull;

import com.aids_malaria.R;
import com.aids_malaria.util.ResourceUtil;
import com.litesuits.orm.db.annotation.NotNull;
import com.litesuits.orm.db.annotation.Table;
import com.litesuits.orm.db.enums.AssignType;

import java.io.Serializable;

@Entity(tableName = "mosquitoInvest",primaryKeys = {"invest_area_code","record_seq"})
public class MosquitoInvest implements Serializable {

    /**
     * aedes_bit_rate : 0
     * aedes_density : 30
     * aedes_infect_rate : 0
     * anopheles_bit_rate : 0.536
     * anopheles_density : 80
     * anopheles_infect_rate : 0.1
     * creating_time : 2020-03-08
     * creator : admin
     * culex_bit_rate : 0.125
     * culex_density : 50
     * culex_infect_rate : 0.03
     * invest_area_code : 60001
     * invest_place : 100m south of Conde
     * invest_time : 2020-03-08
     * investor : admin
     * other_bit_rate : 0
     * other_density : 0
     * other_infect_rate : 0
     * record_seq : 1
     * update_time :
     * updator :
     * x : 7.26
     * y : 1.392
     */
    public static final int SORT_TYPE_AEDES = 1; //伊蚊
    public static final int SORT_TYPE_ANOPHELES = 2; //按蚊
    public static final int SORT_TYPE_CULEX = 3; //库蚊
    public static final int SORT_TYPE_OTHER = 4; //其它
    private int sortType; //种类

    private double aedes_bit_rate; //伊蚊叮咬率
    private double aedes_density; //伊蚊密度
    private double aedes_infect_rate; //伊蚊感染阳性

    private double anopheles_bit_rate; //按蚊叮咬率
    private double anopheles_density; //按蚊密度
    private double anopheles_infect_rate; //按蚊感染阳性

    private double culex_bit_rate; //库蚊叮咬率
    private double culex_density; //库蚊密度
    private double culex_infect_rate; //库蚊感染阳性

    private double other_bit_rate; //其它蚊叮咬率
    private double other_density; //其它蚊密度
    private double other_infect_rate; //其它蚊感染阳

    private String creating_time; //记录创建时间
    private String creator; //记录创建人
//    @PrimaryKey(AssignType.BY_MYSELF)
    @NonNull
    private String invest_area_code; //现居住地
    private int record_seq; //记录次数
    private String invest_place; //调查地点
    private String invest_time; //调查时间
    private String investor; //调查人员
    private String update_time; //记录更改时间
    private String updator; //记录更改人
    private double x; //地点经度
    private double y; //地点纬度
    private String busy_type;
    private boolean createOrUpdate = false;

    public boolean isCreateOrUpdate() {
        return createOrUpdate;
    }

    public void setCreateOrUpdate(boolean createOrUpdate) {
        this.createOrUpdate = createOrUpdate;
    }

    public static MosquitoInvest copyToItem(MosquitoInvest mosquitoInvestData){
        MosquitoInvest mosquitoInvest = new MosquitoInvest();
        mosquitoInvest.setAedes_density(mosquitoInvestData.getAedes_density());
        mosquitoInvest.setAedes_bit_rate(mosquitoInvestData.getAedes_bit_rate());
        mosquitoInvest.setAedes_infect_rate(mosquitoInvestData.getAedes_infect_rate());

        mosquitoInvest.setAnopheles_density(mosquitoInvestData.getAnopheles_density());
        mosquitoInvest.setAnopheles_bit_rate(mosquitoInvestData.getAnopheles_bit_rate());
        mosquitoInvest.setAnopheles_infect_rate(mosquitoInvestData.getAnopheles_infect_rate());

        mosquitoInvest.setCulex_density(mosquitoInvestData.getCulex_density());
        mosquitoInvest.setCulex_bit_rate(mosquitoInvestData.getCulex_bit_rate());
        mosquitoInvest.setCulex_infect_rate(mosquitoInvestData.getCulex_infect_rate());

        mosquitoInvest.setOther_density(mosquitoInvestData.getOther_density());
        mosquitoInvest.setOther_bit_rate(mosquitoInvestData.getOther_bit_rate());
        mosquitoInvest.setOther_infect_rate(mosquitoInvestData.getOther_infect_rate());

        mosquitoInvest.setCreating_time(mosquitoInvestData.getCreating_time());
        mosquitoInvest.setCreator(mosquitoInvestData.getCreator());
        mosquitoInvest.setInvest_area_code(mosquitoInvestData.getInvest_area_code());
        mosquitoInvest.setInvest_place(mosquitoInvestData.getInvest_place());
        mosquitoInvest.setInvest_time(mosquitoInvestData.getInvest_time());
        mosquitoInvest.setInvestor(mosquitoInvestData.getInvestor());
        mosquitoInvest.setRecord_seq(mosquitoInvestData.getRecord_seq());
        mosquitoInvest.setUpdate_time(mosquitoInvestData.getUpdate_time());
        mosquitoInvest.setUpdator(mosquitoInvestData.getUpdator());
        mosquitoInvest.setX(mosquitoInvestData.getX());
        mosquitoInvest.setY(mosquitoInvestData.getY());
        mosquitoInvest.setBusy_type(mosquitoInvestData.getBusy_type());
        mosquitoInvest.setCreateOrUpdate(mosquitoInvestData.isCreateOrUpdate());
        return mosquitoInvest;
    }

    public String getBusy_type() {
        return busy_type;
    }

    public void setBusy_type(String busy_type) {
        this.busy_type = busy_type;
    }

    public int getSortType() {
        return sortType;
    }

    public void setSortType(int sortType) {
        this.sortType = sortType;
    }

    public String getSortTypeName(){
        String sortTypeString = "";
        if(sortType == SORT_TYPE_AEDES){
            sortTypeString = ResourceUtil.getString(R.string.aedes);
        }else if(sortType == SORT_TYPE_ANOPHELES){
            sortTypeString = ResourceUtil.getString(R.string.anopheles);
        }else if(sortType == SORT_TYPE_CULEX){
            sortTypeString = ResourceUtil.getString(R.string.culex);
        }else{
            sortTypeString = ResourceUtil.getString(R.string.other);
        }
        return sortTypeString;
    }

    public double getAedes_bit_rate() {
        return aedes_bit_rate;
    }

    public void setAedes_bit_rate(double aedes_bit_rate) {
        this.aedes_bit_rate = aedes_bit_rate;
    }

    public double getAedes_density() {
        return aedes_density;
    }

    public void setAedes_density(double aedes_density) {
        this.aedes_density = aedes_density;
    }

    public double getAedes_infect_rate() {
        return aedes_infect_rate;
    }

    public void setAedes_infect_rate(double aedes_infect_rate) {
        this.aedes_infect_rate = aedes_infect_rate;
    }

    public double getAnopheles_bit_rate() {
        return anopheles_bit_rate;
    }

    public void setAnopheles_bit_rate(double anopheles_bit_rate) {
        this.anopheles_bit_rate = anopheles_bit_rate;
    }

    public double getAnopheles_density() {
        return anopheles_density;
    }

    public void setAnopheles_density(double anopheles_density) {
        this.anopheles_density = anopheles_density;
    }

    public double getAnopheles_infect_rate() {
        return anopheles_infect_rate;
    }

    public void setAnopheles_infect_rate(double anopheles_infect_rate) {
        this.anopheles_infect_rate = anopheles_infect_rate;
    }

    public String getCreating_time() {
        return creating_time;
    }

    public void setCreating_time(String creating_time) {
        this.creating_time = creating_time;
    }

    public String getCreator() {
        return creator;
    }

    public void setCreator(String creator) {
        this.creator = creator;
    }

    public double getCulex_bit_rate() {
        return culex_bit_rate;
    }

    public void setCulex_bit_rate(double culex_bit_rate) {
        this.culex_bit_rate = culex_bit_rate;
    }

    public double getCulex_density() {
        return culex_density;
    }

    public void setCulex_density(double culex_density) {
        this.culex_density = culex_density;
    }

    public double getCulex_infect_rate() {
        return culex_infect_rate;
    }

    public void setCulex_infect_rate(double culex_infect_rate) {
        this.culex_infect_rate = culex_infect_rate;
    }

    public String getInvest_area_code() {
        return invest_area_code;
    }

    public void setInvest_area_code(String invest_area_code) {
        this.invest_area_code = invest_area_code;
    }

    public String getInvest_place() {
        return invest_place;
    }

    public void setInvest_place(String invest_place) {
        this.invest_place = invest_place;
    }

    public String getInvest_time() {
        return invest_time;
    }

    public void setInvest_time(String invest_time) {
        this.invest_time = invest_time;
    }

    public String getInvestor() {
        return investor;
    }

    public void setInvestor(String investor) {
        this.investor = investor;
    }

    public double getOther_bit_rate() {
        return other_bit_rate;
    }

    public void setOther_bit_rate(double other_bit_rate) {
        this.other_bit_rate = other_bit_rate;
    }

    public double getOther_density() {
        return other_density;
    }

    public void setOther_density(double other_density) {
        this.other_density = other_density;
    }

    public double getOther_infect_rate() {
        return other_infect_rate;
    }

    public void setOther_infect_rate(double other_infect_rate) {
        this.other_infect_rate = other_infect_rate;
    }

    public int getRecord_seq() {
        return record_seq;
    }

    public void setRecord_seq(int record_seq) {
        this.record_seq = record_seq;
    }

    public String getUpdate_time() {
        return update_time;
    }

    public void setUpdate_time(String update_time) {
        this.update_time = update_time;
    }

    public String getUpdator() {
        return updator;
    }

    public void setUpdator(String updator) {
        this.updator = updator;
    }

    public double getX() {
        return x;
    }

    public void setX(double x) {
        this.x = x;
    }

    public double getY() {
        return y;
    }

    public void setY(double y) {
        this.y = y;
    }
}
